﻿using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using Resn.WhuPub.BIL;
using Resn.WhuPub.BLL;

namespace Resn.WhuPub.WPFClientUI
{
        /// <summary>
        /// SystemPage.xaml 的交互逻辑
        /// </summary>
        public partial class AdminPage : Page
        {
                private readonly GlobalManager gm = GlobalManager.Instance;

                public AdminPage()
                {
                        InitializeComponent();
                }

                private void Page_Loaded(object sender, RoutedEventArgs e)
                {
                        LayoutRoot.DataContext = gm;
                }

                private void ManageEmployeesButton_Click(object sender, RoutedEventArgs e)
                {
                        gm.Employees = EmployeeManager.Instance.Employees;
                        NavigationService.Navigate(new Uri("ManageEmployeesPage.xaml", UriKind.Relative));
                }

                private void ImportCorporatesButton_Click(object sender, RoutedEventArgs e)
                {
                        NavigationService.Navigate(new Uri("ImportCorporatesPage.xaml", UriKind.Relative));
                }

                private void ManageCorporatesButton_OnClick(object sender, RoutedEventArgs e)
                {
                        gm.Corporates = CorporateManager.Instance.Corporates;
                        NavigationService.Navigate(new Uri("ManageCorporatesPage.xaml", UriKind.Relative));
                }

                private void ManageCorporateBranchsButton_OnClick(object sender, RoutedEventArgs e)
                {
                        gm.CorporateBranchs = CorporateManager.Instance.CorporateBranchs;
                        NavigationService.Navigate(new Uri("ManageCorporateBranchsPage.xaml", UriKind.Relative));
                }

                

                

                private void ImportContactsButton_Click(object sender, RoutedEventArgs e)
                {
                        NavigationService.Navigate(new Uri("ImportContactsPage.xaml", UriKind.Relative));
                }

                private void ManageContactsButton_Click(object sender, RoutedEventArgs e)
                {
                        gm.Contacts = ContactManager.Instance.Contacts;
                        NavigationService.Navigate(new Uri("ManageContactsPage.xaml", UriKind.Relative));
                }

                private void ImportCategorysButton_Click(object sender, RoutedEventArgs e)
                {
                        NavigationService.Navigate(new Uri("ImportCategorysPage.xaml", UriKind.Relative));
                }

                private void ManageCategorysButton_OnClick(object sender, RoutedEventArgs e)
                {
                        gm.Categorys = CategoryManager.Instance.Categorys;
                        NavigationService.Navigate(new Uri("ManageCategorysPage.xaml", UriKind.Relative));
                }

                private void ManageSubjectsButton_Click(object sender, RoutedEventArgs e)
                {
                        gm.Subjects = CategoryManager.Instance.Subjects;
                        NavigationService.Navigate(new Uri("ManageSubjectsPage.xaml", UriKind.Relative));
                }

                private void ManageMajorsButton_Click(object sender, RoutedEventArgs e)
                {
                        gm.Majors = CategoryManager.Instance.Majors;
                        NavigationService.Navigate(new Uri("ManageMajorsPage.xaml", UriKind.Relative));
                }

                private void ImportBooksButton_Click(object sender, RoutedEventArgs e)
                {
                        NavigationService.Navigate(new Uri("ImportBooksPage.xaml", UriKind.Relative));
                }

                private void ManageBooksButton_Click(object sender, RoutedEventArgs e)
                {
                        gm.Books = BookManager.Instance.Books;
                        NavigationService.Navigate(new Uri("ManageBooksPage.xaml", UriKind.Relative));
                }

                
        }
}